
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module fgcp.connection</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="fgcp.html"><font color="#ffffff">fgcp</font></a>.connection</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="http://code.google.com/p/fgcp-client-api/source/browse/fgcp/connection.py">connection.py</a></font></td></tr></table>
    <p><tt>XML-RPC&nbsp;Connection&nbsp;with&nbsp;the&nbsp;Fujitsu&nbsp;Global&nbsp;Cloud&nbsp;Platform&nbsp;(FGCP)&nbsp;API&nbsp;Server<br>
&nbsp;<br>
Example:&nbsp;[not&nbsp;recommended,&nbsp;use&nbsp;API&nbsp;Commands,&nbsp;Resource&nbsp;Actions&nbsp;and/or&nbsp;Client&nbsp;Methods&nbsp;instead]<br>
&nbsp;<br>
#&nbsp;Connect&nbsp;with&nbsp;your&nbsp;client&nbsp;certificate&nbsp;to&nbsp;region&nbsp;'uk'<br>
from&nbsp;fgcp.connection&nbsp;import&nbsp;<a href="#FGCPProxyServer">FGCPProxyServer</a><br>
xmlrpc_proxy&nbsp;=&nbsp;<a href="#FGCPProxyServer">FGCPProxyServer</a>('client.pem',&nbsp;'uk')<br>
&nbsp;<br>
#&nbsp;Send&nbsp;XML-RPC&nbsp;actions,&nbsp;request&nbsp;parameters&nbsp;and&nbsp;attachments<br>
vsystems&nbsp;=&nbsp;xmlrpc_proxy.do_action('ListVSYS')<br>
for&nbsp;vsys&nbsp;in&nbsp;vsystems:<br>
&nbsp;&nbsp;&nbsp;&nbsp;status&nbsp;=&nbsp;xmlrpc_proxy.do_action('GetVSYSStatus',&nbsp;{'vsysId':&nbsp;vsys.vsysId})<br>
&nbsp;&nbsp;&nbsp;&nbsp;vsysconfig&nbsp;=&nbsp;xmlrpc_proxy.do_action('GetVSYSConfiguration',&nbsp;{'vsysId':&nbsp;vsys.vsysId})<br>
&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;vserver&nbsp;in&nbsp;vsysconfig.vservers:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status&nbsp;=&nbsp;xmlrpc_proxy.do_action('GetVServerStatus',&nbsp;{'vsysId':&nbsp;vsys.vsysId,&nbsp;'vserverId':&nbsp;vserver.vserverId})<br>
&nbsp;&nbsp;&nbsp;&nbsp;...</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="xml.etree.ElementTree.html">xml.etree.ElementTree</a><br>
<a href="base64.html">base64</a><br>
</td><td width="25%" valign=top><a href="gdata.tlslite.utils.keyfactory.html">gdata.tlslite.utils.keyfactory</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="fgcp.html#FGCPError">fgcp.FGCPError</a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="fgcp.connection.html#FGCPResponseError">FGCPResponseError</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="fgcp.connection.html#FGCPConnection">FGCPConnection</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="fgcp.connection.html#FGCPProxyServer">FGCPProxyServer</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="fgcp.connection.html#FGCPResponseParser">FGCPResponseParser</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FGCPConnection">class <strong>FGCPConnection</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>FGCP&nbsp;XML-RPC&nbsp;Connection<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FGCPConnection-__init__"><strong>__init__</strong></a>(self, key_file<font color="#909090">='client.pem'</font>, region<font color="#909090">='de'</font>, verbose<font color="#909090">=0</font>, debug<font color="#909090">=0</font>, conn<font color="#909090">=None</font>)</dt><dd><tt>Use&nbsp;the&nbsp;same&nbsp;PEM&nbsp;file&nbsp;for&nbsp;SSL&nbsp;client&nbsp;certificate&nbsp;and&nbsp;RSA&nbsp;key&nbsp;signature<br>
&nbsp;<br>
Note:&nbsp;to&nbsp;convert&nbsp;your&nbsp;.p12&nbsp;or&nbsp;.pfx&nbsp;file&nbsp;to&nbsp;unencrypted&nbsp;PEM&nbsp;format,&nbsp;you&nbsp;can&nbsp;use<br>
the&nbsp;following&nbsp;'openssl'&nbsp;command:<br>
&nbsp;<br>
openssl&nbsp;pkcs12&nbsp;-in&nbsp;UserCert.p12&nbsp;-out&nbsp;client.pem&nbsp;-nodes</tt></dd></dl>

<dl><dt><a name="FGCPConnection-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPConnection-add_param"><strong>add_param</strong></a>(self, key<font color="#909090">=None</font>, value<font color="#909090">=None</font>, depth<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="FGCPConnection-close"><strong>close</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPConnection-connect"><strong>connect</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPConnection-do_action"><strong>do_action</strong></a>(self, action, params<font color="#909090">=None</font>, attachments<font color="#909090">=None</font>)</dt><dd><tt>Send&nbsp;the&nbsp;XML-RPC&nbsp;request&nbsp;and&nbsp;get&nbsp;the&nbsp;response</tt></dd></dl>

<dl><dt><a name="FGCPConnection-get_accesskeyid"><strong>get_accesskeyid</strong></a>(self)</dt><dd><tt>#&nbsp;see&nbsp;com.fujitsu.oviss.pub.OViSSSignature</tt></dd></dl>

<dl><dt><a name="FGCPConnection-get_body"><strong>get_body</strong></a>(self, action, params<font color="#909090">=None</font>, attachments<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="FGCPConnection-get_headers"><strong>get_headers</strong></a>(self, attachments<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="FGCPConnection-get_signature"><strong>get_signature</strong></a>(self, acc<font color="#909090">=None</font>)</dt><dd><tt>#&nbsp;see&nbsp;com.fujitsu.oviss.pub.OViSSSignature</tt></dd></dl>

<dl><dt><a name="FGCPConnection-receive"><strong>receive</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPConnection-send"><strong>send</strong></a>(self, method, uri, body, headers)</dt></dl>

<dl><dt><a name="FGCPConnection-set_conn"><strong>set_conn</strong></a>(self, conn)</dt></dl>

<dl><dt><a name="FGCPConnection-set_key"><strong>set_key</strong></a>(self, key_string)</dt></dl>

<dl><dt><a name="FGCPConnection-set_region"><strong>set_region</strong></a>(self, region)</dt></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>api_version</strong> = '2012-02-18'</dl>

<dl><dt><strong>debug</strong> = 0</dl>

<dl><dt><strong>key_file</strong> = 'client.pem'</dl>

<dl><dt><strong>locale</strong> = 'en'</dl>

<dl><dt><strong>region</strong> = 'de'</dl>

<dl><dt><strong>timezone</strong> = 'Central European Time'</dl>

<dl><dt><strong>uri</strong> = '/ovissapi/endpoint'</dl>

<dl><dt><strong>user_agent</strong> = 'OViSS-API-CLIENT'</dl>

<dl><dt><strong>verbose</strong> = 0</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FGCPProxyServer">class <strong>FGCPProxyServer</strong></a>(<a href="fgcp.connection.html#FGCPConnection">FGCPConnection</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>FGCP&nbsp;XML-RPC&nbsp;Proxy&nbsp;Server<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods inherited from <a href="fgcp.connection.html#FGCPConnection">FGCPConnection</a>:<br>
<dl><dt><a name="FGCPProxyServer-__init__"><strong>__init__</strong></a>(self, key_file<font color="#909090">='client.pem'</font>, region<font color="#909090">='de'</font>, verbose<font color="#909090">=0</font>, debug<font color="#909090">=0</font>, conn<font color="#909090">=None</font>)</dt><dd><tt>Use&nbsp;the&nbsp;same&nbsp;PEM&nbsp;file&nbsp;for&nbsp;SSL&nbsp;client&nbsp;certificate&nbsp;and&nbsp;RSA&nbsp;key&nbsp;signature<br>
&nbsp;<br>
Note:&nbsp;to&nbsp;convert&nbsp;your&nbsp;.p12&nbsp;or&nbsp;.pfx&nbsp;file&nbsp;to&nbsp;unencrypted&nbsp;PEM&nbsp;format,&nbsp;you&nbsp;can&nbsp;use<br>
the&nbsp;following&nbsp;'openssl'&nbsp;command:<br>
&nbsp;<br>
openssl&nbsp;pkcs12&nbsp;-in&nbsp;UserCert.p12&nbsp;-out&nbsp;client.pem&nbsp;-nodes</tt></dd></dl>

<dl><dt><a name="FGCPProxyServer-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPProxyServer-add_param"><strong>add_param</strong></a>(self, key<font color="#909090">=None</font>, value<font color="#909090">=None</font>, depth<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="FGCPProxyServer-close"><strong>close</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPProxyServer-connect"><strong>connect</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPProxyServer-do_action"><strong>do_action</strong></a>(self, action, params<font color="#909090">=None</font>, attachments<font color="#909090">=None</font>)</dt><dd><tt>Send&nbsp;the&nbsp;XML-RPC&nbsp;request&nbsp;and&nbsp;get&nbsp;the&nbsp;response</tt></dd></dl>

<dl><dt><a name="FGCPProxyServer-get_accesskeyid"><strong>get_accesskeyid</strong></a>(self)</dt><dd><tt>#&nbsp;see&nbsp;com.fujitsu.oviss.pub.OViSSSignature</tt></dd></dl>

<dl><dt><a name="FGCPProxyServer-get_body"><strong>get_body</strong></a>(self, action, params<font color="#909090">=None</font>, attachments<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="FGCPProxyServer-get_headers"><strong>get_headers</strong></a>(self, attachments<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="FGCPProxyServer-get_signature"><strong>get_signature</strong></a>(self, acc<font color="#909090">=None</font>)</dt><dd><tt>#&nbsp;see&nbsp;com.fujitsu.oviss.pub.OViSSSignature</tt></dd></dl>

<dl><dt><a name="FGCPProxyServer-receive"><strong>receive</strong></a>(self)</dt></dl>

<dl><dt><a name="FGCPProxyServer-send"><strong>send</strong></a>(self, method, uri, body, headers)</dt></dl>

<dl><dt><a name="FGCPProxyServer-set_conn"><strong>set_conn</strong></a>(self, conn)</dt></dl>

<dl><dt><a name="FGCPProxyServer-set_key"><strong>set_key</strong></a>(self, key_string)</dt></dl>

<dl><dt><a name="FGCPProxyServer-set_region"><strong>set_region</strong></a>(self, region)</dt></dl>

<hr>
Data and other attributes inherited from <a href="fgcp.connection.html#FGCPConnection">FGCPConnection</a>:<br>
<dl><dt><strong>api_version</strong> = '2012-02-18'</dl>

<dl><dt><strong>debug</strong> = 0</dl>

<dl><dt><strong>key_file</strong> = 'client.pem'</dl>

<dl><dt><strong>locale</strong> = 'en'</dl>

<dl><dt><strong>region</strong> = 'de'</dl>

<dl><dt><strong>timezone</strong> = 'Central European Time'</dl>

<dl><dt><strong>uri</strong> = '/ovissapi/endpoint'</dl>

<dl><dt><strong>user_agent</strong> = 'OViSS-API-CLIENT'</dl>

<dl><dt><strong>verbose</strong> = 0</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FGCPResponseError">class <strong>FGCPResponseError</strong></a>(<a href="fgcp.html#FGCPError">fgcp.FGCPError</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="fgcp.connection.html#FGCPResponseError">FGCPResponseError</a></dd>
<dd><a href="fgcp.html#FGCPError">fgcp.FGCPError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods inherited from <a href="fgcp.html#FGCPError">fgcp.FGCPError</a>:<br>
<dl><dt><a name="FGCPResponseError-__init__"><strong>__init__</strong></a>(self, status, message)</dt></dl>

<dl><dt><a name="FGCPResponseError-__str__"><strong>__str__</strong></a>(self)</dt></dl>

<hr>
Data descriptors inherited from <a href="fgcp.html#FGCPError">fgcp.FGCPError</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#FGCPResponseError-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;object&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="FGCPResponseError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="FGCPResponseError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#FGCPResponseError-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="FGCPResponseError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="FGCPResponseError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="FGCPResponseParser">class <strong>FGCPResponseParser</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>FGCP&nbsp;Response&nbsp;Parser<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="FGCPResponseParser-clean_tag"><strong>clean_tag</strong></a>(self, tag)</dt><dd><tt>Return&nbsp;the&nbsp;tag&nbsp;without&nbsp;namespace</tt></dd></dl>

<dl><dt><a name="FGCPResponseParser-get_tag_object"><strong>get_tag_object</strong></a>(self, tag)</dt></dl>

<dl><dt><a name="FGCPResponseParser-parse_data"><strong>parse_data</strong></a>(self, data, proxy)</dt><dd><tt>Load&nbsp;the&nbsp;data&nbsp;as&nbsp;XML&nbsp;ElementTree&nbsp;and&nbsp;convert&nbsp;to&nbsp;FGCP&nbsp;Response</tt></dd></dl>

<dl><dt><a name="FGCPResponseParser-xmlelement_to_object"><strong>xmlelement_to_object</strong></a>(self, root<font color="#909090">=None</font>, parent<font color="#909090">=None</font>)</dt><dd><tt>Convert&nbsp;the&nbsp;XML&nbsp;Element&nbsp;to&nbsp;an&nbsp;FGCP&nbsp;Element</tt></dd></dl>

</td></tr></table></td></tr></table>
</body></html>